import Mock from 'mockjs'
import '@/mock/extend'
import {parseUrlParams} from '@/utils/request'
// const Random = Mock.Random;
const source={

  particleSizeDistribution:{
    title: "颗粒度分布",
    child: [
      { title: "A：70-90μm", flag: false, value: 2001001 },
      { title: "B：90-110μm", flag: false, value: 2001002 },
      { title: "C：110-140μm", flag: false, value: 2001003 },
      { title: "D：140-170μm", flag: false, value: 2001004 },
      { title: "E：170-200μm", flag: false, value: 2001005 },
      { title: "F：200-230μm", flag: false, value: 2001006 },
      { title: "G：230-280μm", flag: false, value: 2001007 },
      { title: "H：280-350μm", flag: false, value: 2001008 },
      { title: "I：350-420μm ", flag: false, value: 2001009 },
      { title: "J：>420μm ", flag: false, value: 2001010 }
    ]
  }
}
const source2=[
  { id:1,name:'粘度',list:[{date:'2024/03/21',value:2},
      {date:'2024/03/22',value:3},
      {date:'2024/03/23',value:4},
      {date:'2024/03/24',value:5},
      {date:'2024/03/25',value:6},
      {date:'2024/03/26',value:7},
      {date:'2024/03/27',value:8}]},
  { id:2,name:'密度', list:[{date:'2024/03/21',value:2},
      {date:'2024/03/22',value:3},
      {date:'2024/03/23',value:4},
      {date:'2024/03/24',value:5},
      {date:'2024/03/25',value:6},
      {date:'2024/03/26',value:7},
      {date:'2024/03/27',value:8}]},
  { id:3,name:'介电常数', list:[{date:'2024/03/21',value:2},
      {date:'2024/03/22',value:3},
      {date:'2024/03/23',value:4},
      {date:'2024/03/24',value:5},
      {date:'2024/03/25',value:6},
      {date:'2024/03/26',value:7},
      {date:'2024/03/27',value:8}]},
  { id:4,name:'水活性', list:[{date:'2024/03/21',value:2},
      {date:'2024/03/22',value:3},
      {date:'2024/03/23',value:4},
      {date:'2024/03/24',value:5},
      {date:'2024/03/25',value:6},
      {date:'2024/03/26',value:7},
      {date:'2024/03/27',value:8}]},
  { id:5,name:'含水量', list:[{date:'2024/03/21',value:2},
      {date:'2024/03/22',value:3},
      {date:'2024/03/23',value:4},
      {date:'2024/03/24',value:5},
      {date:'2024/03/25',value:6},
      {date:'2024/03/26',value:7},
      {date:'2024/03/27',value:8}]},
]
Mock.mock(RegExp(`${process.env.VUE_APP_API_BASE_URL}/detials` + '.*'),'get', ({url}) => {
  const params = parseUrlParams(decodeURI(url))
  let {type} = params
  console.log(url)
  return {
    code: 0,
    message: 'success',
    data:type==1? source:source2
  }
})
